home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / science / mcalc13.zip / MCALC.H < prev    next >
C/C++ Source or Header  |  1994-02-15  |  10KB  |  274 lines

  1. /*
  2. Auto:        smake MCalc
  3. */
  4.  
  5.  
  6. /* $Revision Header built automatically *************** (do not edit) ************
  7. **
  8. ** ⌐ Copyright by GuntherSoft
  9. **
  10. ** File             : SnakeSYS:CPrgs/MUICalc/MCalc.h
  11. ** Created on       : Saturday, 02.10.93 02:16:34
  12. ** Created by       : Kai Iske
  13. ** Current revision : V1.3
  14. **
  15. **
  16. ** Purpose
  17. ** -------
  18. **   - Header-File for MCalc
  19. **
  20. ** Revision V1.3
  21. ** --------------
  22. ** created on Friday, 11.02.94 23:34:08  by  Kai Iske.   LogMessage :
  23. **  -*-  changed on Friday, 11.02.94 23:35:32  by  Kai Iske.   LogMessage :
  24. **   - One couldn`t use 1e3 for scientific notation of 1000. You
  25. **     had to write 1.0e3. Changed
  26. **     (Reported by : Henry Norman)
  27. **   - No more error lines will be copied from History
  28. **     (Requested by : Stefan Stuntz)
  29. **  -*-  created on Friday, 11.02.94 23:34:08  by  Kai Iske.   LogMessage :
  30. **   - "Radiant" was wrong. Changed. Why didn`t anybody tell me.
  31. **     (Reported by : Henry Norman)
  32. **   - Chose wrong case for mathematical "e".
  33. **     (Reported by : Henry Norman)
  34. **
  35. ** Revision V1.2
  36. ** --------------
  37. ** created on Tuesday, 19.10.93 23:41:00  by  Kai Iske.   LogMessage :
  38. **  -*-  changed on Wednesday, 08.12.93 23:48:31  by  Kai Iske.   LogMessage :
  39. **   - Default number of history lines increased
  40. **     (Requested by : Stefan Stuntz)
  41. **  -*-  changed on Sunday, 05.12.93 22:30:41  by  Kai Iske.   LogMessage :
  42. **   - No checks were made on the ENTRY argument to an ARexx
  43. **     function
  44. **  -*-  changed on Sunday, 05.12.93 18:13:56  by  Kai Iske.   LogMessage :
  45. **   - For calculations via ARexx one can set the type, size, sign
  46. **     and angle flags seperately, now
  47. **  -*-  changed on Sunday, 05.12.93 17:50:09  by  Kai Iske.   LogMessage :
  48. **   - Improved error handling from within ARexx commands a bit
  49. **  -*-  changed on Sunday, 05.12.93 17:46:35  by  Kai Iske.   LogMessage :
  50. **   - MUIProCalc may output TeX style mathematical expressions
  51. **     when using the ARexx commands. Additionally there is another
  52. **     option to convert expressions to TeX format.
  53. **     (Requested by : Volker Gⁿth)
  54. **  -*-  changed on Sunday, 05.12.93 16:47:59  by  Kai Iske.   LogMessage :
  55. **   - Added more ARexx functions to the default ones
  56. **     (CALC, GETINPUT, GETOUTPUT)
  57. **     (Requested by : Volker Gⁿth)
  58. **  -*-  changed on Sunday, 05.12.93 01:47:36  by  Kai Iske.   LogMessage :
  59. **   - MUIProCalc didn`t handle extremly small values
  60. **     (Reported by : Volker Gⁿth)
  61. **  -*-  changed on Sunday, 05.12.93 01:38:18  by  Kai Iske.   LogMessage :
  62. **   - Default values weren`t set up
  63. **   - ACLR and CLR gadget have got menu entries too, now
  64. **     (Requested by : Volker Gⁿth)
  65. **   - History entries may be copied to clipboard now
  66. **     (Requested by : Volker Gⁿth)
  67. **  -*-  changed on Saturday, 27.11.93 01:01:25  by  Kai Iske.   LogMessage :
  68. **   - Recompiled using SAS 6.50
  69. **  -*-  changed on Wednesday, 20.10.93 00:24:41  by  Kai Iske.   LogMessage :
  70. **   - Bug in ListView display fixed
  71. **  -*-  created on Tuesday, 19.10.93 23:41:00  by  Kai Iske.   LogMessage :
  72. **   - You may now tell MCalc to clear the input string after
  73. **     hitting RETURN or EXEC.
  74. **
  75. ** Revision V1.1
  76. ** --------------
  77. ** created on Tuesday, 12.10.93 01:50:26  by  Kai Iske.   LogMessage :
  78. **  -*-  changed on Sunday, 17.10.93 15:03:10  by  Kai Iske.   LogMessage :
  79. **   - Save and Use gadgets weren`t arranged as proposed
  80. **     by the AUISG. (Reported by: Stefan Stuntz)
  81. **   - Changed layout of Prefs window a bit
  82. **     (Suggested by: Stefan Stuntz)
  83. **  -*-  changed on Friday, 15.10.93 18:39:50  by  Kai Iske.   LogMessage :
  84. **   - NOT operator didn`t behave as expected ;) It was a simple
  85. **     negate... (Reported by : Top on IRC)
  86. **  -*-  changed on Thursday, 14.10.93 18:01:32  by  Kai Iske.   LogMessage :
  87. **   - Hex-Values may be entered using 'C'-Style now (e.g. 0xff)
  88. **  -*-  changed on Thursday, 14.10.93 00:34:55  by  Kai Iske.   LogMessage :
  89. **   - One can use the faktorian '!' behind numbers now, too.
  90. **     (Suggested by : Top on IRC)
  91. **  -*-  changed on Thursday, 14.10.93 00:28:52  by  Kai Iske.   LogMessage :
  92. **   - One could accidentially change the ordering of the
  93. **     functions and input-gadgets groups by using
  94. **     'No Functions'áand 'No Input' (reported by: Top on IRC)
  95. **  -*-  created on Tuesday, 12.10.93 01:50:26  by  Kai Iske.   LogMessage :
  96. **   - Order of Input and Ouput gadgets (String + ListView) may be
  97. **     set now, ie. the input string may show up underneith the
  98. **     ListView and vice versa (Requested by Dirk Federlein)
  99. **
  100. ** Revision V1.0
  101. ** --------------
  102. ** created on Saturday, 02.10.93 02:16:34  by  Kai Iske.   LogMessage :
  103. **     --- Initial release ---
  104. **
  105. *********************************************************************************/
  106. #define REVISION "1.3"
  107. #define REVDATE  "11.02.94"
  108. #define REVTIME  "23:35:32"
  109. #define AUTHOR   "Kai Iske"
  110. #define VERNUM   1
  111. #define REVNUM   3
  112.  
  113.  
  114. #ifndef        MCALC_H
  115. #define        MCALC_H
  116.  
  117.  
  118.  
  119. /**********************************************************************/
  120. /*                         Parser-Prototypes                          */
  121. /**********************************************************************/
  122. int        yyparse(void);
  123. int        yyerror(char *s);
  124. ULONG        make_ulong(double OldVal);
  125. double        calc_fak(double Fak);
  126. double        calc_angle(double Value);
  127. BOOL        check_angle(double Value, int Mode);
  128.  
  129.  
  130.  
  131. /**********************************************************************/
  132. /*                         Scanner-Prototypes                         */
  133. /**********************************************************************/
  134. int    yylex(void);
  135. void    count(void);
  136. int    calc_int_value(char *s);
  137. int    calc_hex_value(char *s, int leng);
  138. int    calc_bin_value(char *s);
  139. int    calc_oct_value(char *s);
  140. int    calc_dbl_value(char *s);
  141.  
  142.  
  143.  
  144. /**********************************************************************/
  145. /*                   Error-Codes for Scanner/Parser                   */
  146. /**********************************************************************/
  147. #define    ERR_PARSE    1
  148. #define    ERR_UNKNOWN_CHR    2
  149. #define    ERR_DIVBY0    3
  150. #define    ERR_OVERFLOW    4
  151.  
  152.  
  153.  
  154. /**********************************************************************/
  155. /*                        Assembler-Prototypes                        */
  156. /**********************************************************************/
  157. ULONG    __asm MyASL(register __d0 ULONG In, register __d1 ULONG Out);
  158. ULONG    __asm MyASR(register __d0 ULONG In, register __d1 ULONG Out);
  159. ULONG    __asm MyLSL(register __d0 ULONG In, register __d1 ULONG Out);
  160. ULONG    __asm MyLSR(register __d0 ULONG In, register __d1 ULONG Out);
  161. ULONG    __asm MyROL(register __d0 ULONG In, register __d1 ULONG Out);
  162. ULONG    __asm MyROR(register __d0 ULONG In, register __d1 ULONG Out);
  163. ULONG    __asm MyXOR(register __d0 ULONG In, register __d1 ULONG Out);
  164. ULONG    __asm MyNAND(register __d0 ULONG In, register __d1 ULONG Out);
  165. ULONG    __asm MyNOR(register __d0 ULONG In, register __d1 ULONG Out);
  166. ULONG    __asm MyNXOR(register __d0 ULONG In, register __d1 ULONG Out);
  167. APTR    __asm DoCreatePool(register __d0 ULONG, register __d1 ULONG, register __d2 ULONG);
  168. void    __asm DoDeletePool(register __a0 APTR);
  169. APTR    __asm AllocVecPool(register __a0 APTR, register __d0 ULONG);
  170. void    __asm FreeVecPool(register __a0 APTR, register __a1 APTR);
  171.  
  172.  
  173.  
  174. /**********************************************************************/
  175. /*                   Structure for ListView display                   */
  176. /**********************************************************************/
  177. struct    ListStruct
  178. {
  179.     char    Input[258];
  180.     char    Output[258];
  181. };
  182.  
  183.  
  184.  
  185.  
  186.  
  187. /**********************************************************************/
  188. /*                         Some nice defines                          */
  189. /**********************************************************************/
  190.  
  191.     // This is our Version string
  192.  
  193. #define    MUIVERS        "$VER:MCalc "REVISION" ("REVDATE")"
  194.  
  195.  
  196.     // These are for Button/Menu IDs
  197.  
  198. #define    ID_QUIT        1            // Quit program
  199. #define    ID_ABOUT    2            // Display About
  200. #define    ID_PREFS    3            // Open Prefs
  201.  
  202. #define    ID_PICKLEFT    4            // Pick left entry from History
  203. #define    ID_PICKRIGHT    5            // Pick right entry from History
  204. #define    ID_CLIPCUTLEFT    6            // Clip left entry to clipboard
  205. #define    ID_CLIPCUTRIGHT    7            // Clip right entry to clipboard
  206.  
  207. #define    ID_DECIMAL    8            // Switch to dec display
  208. #define    ID_HEXDECIMAL    9            // Switch to hex display
  209. #define    ID_OCTAL    10            // Switch to oct display
  210. #define    ID_BINARY    11            // Switch to bin display
  211.  
  212. #define    ID_8BIT        12            // Set 8-Bit Base
  213. #define    ID_16BIT    13            // Set 16-Bit Base
  214. #define    ID_32BIT    14            // Set 32-Bit Base
  215.  
  216. #define    ID_SIGNED    15            // Switch to signed dec ouput
  217. #define    ID_UNSIGNED    16            // Switch to unsigned dec output
  218.  
  219. #define    ID_RAD        17            // Radiant angles
  220. #define    ID_DEG        18            // Degree angles
  221.  
  222. #define    ID_INPUT    19            // Received input from String gadget
  223. #define    ID_LISTVIEW    20            // Double clicked on ListView
  224. #define    ID_EXEC        21            // Translate input
  225. #define    ID_CLEAR    22            // Clear input gadget
  226. #define    ID_ALLCLEAR    23            // Clear input gadget AND memory
  227.  
  228.  
  229.  
  230. #define    ID_PREFS_QUIT    50            // Close Prefs window
  231. #define    ID_PREFS_NEW    51            // New Prefs set
  232.  
  233.  
  234.  
  235.  
  236.  
  237. /**********************************************************************/
  238. /*                    Definitions for Online-Help                     */
  239. /**********************************************************************/
  240. #define    HELPFILE        "PROGDIR:MCalc.guide"
  241. #define    NODE_MAIN        "Main"
  242. #define    NODE_INOUTPUT        "InputOutput"
  243. #define    NODE_FUNCTIONS        "FuncTables"
  244. #define    NODE_INPUTS        "Inputs"
  245. #define    NODE_PREFS        "Prefs"
  246. #define    NODE_LAYOUT        "Layout"
  247. #define    NODE_OUTPUT        "Output"
  248. #define    NODE_HISTORY        "History"
  249. #define    NODE_MISC        "Misc"
  250.  
  251.  
  252. /**********************************************************************/
  253. /*                   Defines for Clipboard support                    */
  254. /**********************************************************************/
  255. #define ID_FTXT    MAKE_ID('F','T','X','T')
  256. #define ID_CHRS    MAKE_ID('C','H','R','S')
  257.  
  258.  
  259. /**********************************************************************/
  260. /*                       Some defines for ARexx                       */
  261. /**********************************************************************/
  262. #define    GET_OUTPUT        1
  263. #define    GET_INPUT        2
  264.  
  265. #define    NORMAL_OUTPUT        1
  266. #define    TEX_OUTPUT        2
  267.  
  268. #define    GET_ACTIVE        -1
  269. #define    GET_TOPMOST        -2
  270. #define    GET_BOTTOMMOST        -3
  271.  
  272. #include    "Protos.h"
  273. #endif
  274.